//
//  HMMainTabbar.swift
//  FirstSinaProject-00
//
//  Created by mac on 16/4/7.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

class HMMainTabbar: UITabBar {

    override func layoutSubviews() {
        super.layoutSubviews()
        let itemW  = self.frame.width / 5
        let itemH = self.bounds.height
        let rect = CGRect(x: 0, y: 0, width: itemW, height: itemH)
        var idex:CGFloat = 0
        for subview in subviews {
//            print(subview)
            if subview.isKindOfClass(NSClassFromString("UITabBarButton")!){
                subview.frame = CGRectOffset(rect, idex*itemW, 0)
                if idex == 1{
                    idex++
                }
                idex++
            }
        }
    }
    

}
